<template>
    <div>
      <div class="row">
        <div style="flex-shrink: 0;font-size: 14px;">序号：</div><el-input size="mini"
          style="width: 60px;margin-right: 20px;" v-model="nodeModel.sort"></el-input>
        <div style="flex-shrink: 0;font-size: 14px;">是否显示：</div><el-switch v-model="nodeModel.isShow" :active-value="true"
          :inactive-value="false" active-color="#13ce66" inactive-color="#999999"></el-switch>
          <div style="margin-left: 20px;">
            <el-button @click="selectTemplate" size="mini">选用模版</el-button>
          </div>
      </div>
      <div style="flex-shrink: 0;font-size: 14px;margin-left: 10px;font-size: 16px;font-weight: bold;margin-top: 20px;">
        容器属性：</div>
      <div class="row">
        <div style="flex-shrink: 0;font-size: 14px;">背景色：</div>
        <el-input size="mini" style="width: 100px;" v-model="nodeModel.configDict.componentStyle.background"></el-input>
        <el-color-picker v-model="nodeModel.configDict.componentStyle.background"></el-color-picker>
      </div>
      <div class="row">
        <div style="flex-shrink: 0;font-size: 14px;margin-right: 20px;">排列方向：</div>
        <el-radio v-model="nodeModel.configDict.componentStyle.flex_direction" label='row'>左右</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.flex_direction" label='column'>上下</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.flex_direction" label='row-reverse'>右左</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.flex_direction" label='column-reverse'>下上</el-radio>
      </div>
      <div class="row">
        <div style="flex-shrink: 0;font-size: 14px;margin-right: 20px;">换行类型：</div>
        <el-radio v-model="nodeModel.configDict.componentStyle.flex_wrap" label='wrap'>换行</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.flex_wrap" label='nowrap'>不换行</el-radio>
      </div>
      <div class="row">
        <div style="flex-shrink: 0;font-size: 14px;margin-right: 20px;">主轴对齐方式：</div>
        <el-radio v-model="nodeModel.configDict.componentStyle.justify_content" label='flex-start'>左对齐</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.justify_content" label='flex-end'>右对齐</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.justify_content" label='center'>居中对齐</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.justify_content" label='space-between'>两端对齐</el-radio>
      </div>
      <div class="row">
        <div style="flex-shrink: 0;font-size: 14px;margin-right: 20px;">交叉轴对齐方式：</div>
        <el-radio v-model="nodeModel.configDict.componentStyle.align_items" label='flex-start'>起点对齐</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.align_items" label='flex-end'>终点对齐</el-radio>
        <el-radio v-model="nodeModel.configDict.componentStyle.align_items" label='center'>居中对齐</el-radio>
      </div>
      <div class="column">
        <jcSlider title="宽：" :titleWidth="80"><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.width"
          :min="10" :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="上外边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.marginTop" :min="0"
            :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="下外边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.marginBottom"
            :min="0" :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="左外边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.marginLeft" :min="0"
            :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="右外边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.marginRight"
            :min="0" :max="750" show-input input-size="mini"></el-slider></jcSlider>
      </div>
      <div class="column">
        <jcSlider title="上内边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.paddingTop" :min="0"
            :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="下内边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.paddingBottom"
            :min="0" :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="左内边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.paddingLeft"
            :min="0" :max="750" show-input input-size="mini"></el-slider></jcSlider>
        <jcSlider title="右内边距："><el-slider slot="slider" v-model="nodeModel.configDict.componentStyle.paddingRight"
            :min="0" :max="750" show-input input-size="mini"></el-slider></jcSlider>
      </div>
      <!-- 标题样式 -->
      <div style="background-color: #eee;width: 600px;height: 1px;margin-left: 20px;margin-top: 10px;"></div>
      <div class="column">
        <div style="flex-shrink: 0;font-size: 14px;font-weight: bold;">标题样式：</div>
        <div class="row">
          <div style="flex-shrink: 0;font-size: 14px;">标题：</div><el-input  size="mini" v-model="nodeModel.configDict.itemStyle.text1"></el-input>
        </div>
        <div class="row">
          <div style="flex-shrink: 0;font-size: 14px;">是否显示：</div>
          <el-radio v-model="nodeModel.configDict.itemStyle.isShowForText1" :label='true'>是</el-radio>
          <el-radio v-model="nodeModel.configDict.itemStyle.isShowForText1" :label='false'>否</el-radio>
          <div style="flex-shrink: 0;font-size: 14px;">是否加粗：</div>
          <el-radio v-model="nodeModel.configDict.itemStyle.fontweightForText1" label='bold'>是</el-radio>
          <el-radio v-model="nodeModel.configDict.itemStyle.fontweightForText1" label=''>否</el-radio>
        </div>
        <div class="row" style="margin-left: 50px;">
          <div style="flex-shrink: 0;font-size: 14px;">颜色：</div>
          <el-input size="mini" style="width: 100px;" v-model="nodeModel.configDict.itemStyle.colorForText1"></el-input>
          <el-color-picker v-model="nodeModel.configDict.itemStyle.colorForText1"></el-color-picker>
        </div>
        <div class="column">
          <jcSlider title="边距：" :titleWidth="70"><el-slider slot="slider"
              v-model="nodeModel.configDict.itemStyle.marginForText1" :min="0" :max="100" show-input
              input-size="mini"></el-slider></jcSlider>
          <jcSlider title="字体大小：" :titleWidth="70"><el-slider slot="slider"
              v-model="nodeModel.configDict.itemStyle.fontsizeForText1" :min="10" :max="100" show-input
              input-size="mini"></el-slider></jcSlider>
        </div>
        <!-- 侧标 -->
        <div style="background-color: #eee;width: 600px;height: 1px;margin-left: 20px;margin-top: 10px;"></div>
        <div class="column">
          <div style="flex-shrink: 0;font-size: 14px;font-weight: bold;">侧标样式：</div>
          <div class="row">
            <div style="flex-shrink: 0;font-size: 14px;">是否显示：</div>
            <el-radio v-model="nodeModel.configDict.itemStyle.isShowForText2" :label='true'>是</el-radio>
            <el-radio v-model="nodeModel.configDict.itemStyle.isShowForText2" :label='false'>否</el-radio>
          </div>
          <div class="row">
            <div style="flex-shrink: 0;font-size: 14px;">是否显示双侧标：</div>
            <el-radio v-model="nodeModel.configDict.itemStyle.isShowForText2ForPair" :label='true'>是</el-radio>
            <el-radio v-model="nodeModel.configDict.itemStyle.isShowForText2ForPair" :label='false'>否</el-radio>
          </div>
          <div class="row" style="margin-left: 50px;">
            <div style="flex-shrink: 0;font-size: 14px;">颜色：</div>
            <el-input size="mini" style="width: 100px;" v-model="nodeModel.configDict.itemStyle.backgroundForText2"></el-input>
            <el-color-picker v-model="nodeModel.configDict.itemStyle.backgroundForText2"></el-color-picker>
          </div>
          <div class="column">
          <jcSlider title="宽：" :titleWidth="80"><el-slider slot="slider" v-model="nodeModel.configDict.itemStyle.widthForText2"
            :min="1" :max="750" show-input input-size="mini"></el-slider></jcSlider>
            <jcSlider title="高：" :titleWidth="80"><el-slider slot="slider" v-model="nodeModel.configDict.itemStyle.heightForText2"
              :min="1" :max="750" show-input input-size="mini"></el-slider></jcSlider>
          </div>
        </div>
        <!-- 按钮 -->
        <div style="background-color: #eee;width: 600px;height: 1px;margin-left: 20px;margin-top: 10px;"></div>
          <div style="flex-shrink: 0;font-size: 14px;font-weight: bold;">按钮样式：</div>
          <div class="column">
            <div class="row">
            <div style="flex-shrink: 0;font-size: 14px;">标题：</div><el-input  size="mini" v-model="nodeModel.configDict.itemStyle.titleForBtn1"></el-input>
          </div>
          <div class="row">
            <div style="flex-shrink: 0;font-size: 14px;">是否显示：</div>
            <el-radio v-model="nodeModel.configDict.itemStyle.isShowForBtn1" :label='true'>是</el-radio>
            <el-radio v-model="nodeModel.configDict.itemStyle.isShowForBtn1" :label='false'>否</el-radio>
          </div>
          <div class="row" style="margin-left: 50px;">
            <div style="flex-shrink: 0;font-size: 14px;">颜色：</div>
            <el-input size="mini" style="width: 100px;" v-model="nodeModel.configDict.itemStyle.colorForBtn1"></el-input>
            <el-color-picker v-model="nodeModel.configDict.itemStyle.colorForBtn1"></el-color-picker>
            
          </div>
          <div class="column">
            <jcSlider title="字体大小：" :titleWidth="70"><el-slider slot="slider"
              v-model="nodeModel.configDict.itemStyle.fontsizeForBtn1" :min="10" :max="100" show-input
              input-size="mini"></el-slider></jcSlider>
          </div>
          <div class="row" style="margin-left: 50px;">
            <div style="margin-left: 10px;margin-top: 10px;display: flex;flex-direction: row;">
              <div style="width: 100%;"><el-input style="margin-left: 0px;"  size="mini" v-model="nodeModel.configDict.itemStyle.query"></el-input></div>
              <div><el-button @click="selectRoute(nodeModel.configDict.itemStyle)" size="mini">路由参数</el-button></div>
            </div>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
    import custom from '@/components/jcupload/custom'
    import jcSlider from '@/views/interface/composing/components/jc-slider'
  export default {
    components: {
        custom,
        jcSlider
    },
    props:{
      nodeModel:{
        type: Object,
        default: res=>{}
      }
    },
    data() {
      return {

      }
    },
    methods:{
        insertAdvert(){
            this.$emit('insertAdvert', {name: this.nodeModel.componentModel.name})
        },
        deleteAdvert(index){
            this.$emit('deleteAdvert', index)
        },
        selectRoute(item){
            this.$emit('selectRoute', item)
        },
        selectTemplate(){
            this.$emit('selectTemplate')
        },
    }
  }
</script>

<style lang="scss" scoped>
  @import './commonStyle.scss';
</style>